<template>
	<web-view :webview-styles="webviewStyles" :src="selectUrl"></web-view>
</template>

<script>
export default {
	data() {
		return {
			webSrc: [
				// 常见问题： index 是参数，跳转到索引问题位置
				// `https://m.hn96606.com/webHtml/problem/index.html?index=${options.index}`
				`https://m.hn96606.com/webHtml/problem/index.html?test=${Math.ceil(Math.random() * 100)}`,
				// 购票服务协议
				`https://m.hn96606.com/protocol.html?test=${Math.ceil(Math.random() * 100)}`,
				// 2020保险
				`https://m.hn96606.com/webHtml/baoxian/baoxian1.html?test=${Math.ceil(Math.random() * 100)}`,
				`https://m.hn96606.com/webHtml/baoxian/baoxian2.html?test=${Math.ceil(Math.random() * 100)}`,
				`https://m.hn96606.com/webHtml/baoxian/baoxian3.html?test=${Math.ceil(Math.random() * 100)}`
			],
			selectUrl: '',
			webviewStyles: {
				progress: {
					color: '#FF3333'
				}
			}
		};
	},
	onLoad(options) {
		try {
			// 跳转传入参数index索引指定src
			if(options.index == '0' && options.select){
				this.selectUrl = `https://m.hn96606.com/webHtml/problem/index.html?index=${options.select}`;
			}else{
				this.selectUrl = this.webSrc[Number(options.index)];
			}
			if(options.index == '3'){
				this.selectUrl = this.webSrc[Number(options.index)];
			}
		} catch (err) {}
		
	}
};
</script>

<style></style>
